<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="__PUBLIC__/css/pintuer.css">
<link rel="stylesheet" href="__PUBLIC__/css/admin.css">
<script src="__PUBLIC__/js/jquery.js"></script>
<script src="__PUBLIC__/js/pintuer.js"></script>

<style type="text/css">
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
.ui-timepicker-div dl { text-align: left; }
.ui-timepicker-div dl dt { float: left; clear:left; padding: 0 0 0 5px; }
.ui-timepicker-div dl dd { margin: 0 10px 10px 45%; }
.ui-timepicker-div td { font-size: 90%; }
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
.ui-timepicker-rtl{ direction: rtl; }
.ui-timepicker-rtl dl { text-align: right; padding: 0 5px 0 0; }
.ui-timepicker-rtl dl dt{ float: right; clear: right; }
.ui-timepicker-rtl dl dd { margin: 0 45% 10px 10px; }
/* .input{width:50%;} */
select{height:40px;}
.selinp{width: 15%;font-size: 14px;padding: 10px;display:inline;border: solid 1px #ddd;line-height: 20px;border-radius: 3px;}
</style>  
 
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>增加栏目</strong></div>
  <div class="body-content">
    <form method="post" enctype="multipart/form-data" class="form-x" action="{:U('Admin/Nav/create')}">
    
      <div class="form-group">
        <div class="label">
          <label>上级栏目：</label>
        </div>
        <div class="field">
          <select name="pid" class="input w50">
            <option value="0">作为主栏目</option>
            
            <foreach name="data['cate']" item="list">
    		<option value="{$list.id}">{$list.name}</option>
    			<foreach name="list.child" item="child">
        		<option value="{$child.id}">&nbsp;&nbsp;&nbsp;&nbsp;|--{$child.name}</option>
        			<foreach name="child.child" item="three">
           			<option value="{$three.id}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|--{$three.name}</option>
        			</foreach>
    			</foreach>
			</foreach>
			
          </select>
          
        </div>
      </div>
      
      <div class="form-group">
        <div class="label">
          <label>栏目名称：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50"  value="" name="name" placeholder="请输入栏目名称"  data-validate="required:请输入栏目名称" />
          <div class="tips"></div>
        </div>
      </div>
     
     
     <div class="form-group">
        <div class="label">
          <label>关联模块：</label>
        </div>
        <div class="field">
          <select id="mokuai" name="block" class="selinp">
 		  	<option value ="0">超级链接</option>
    		<option value ="1">文章模块</option>
    		<option value ="2">单页模块</option>
          </select>
          <span id="ccss" ></span>
        </div>
        
      </div>

      <div class="clear"></div>
     
      <div class="form-group">
        <div class="label">
          <label>排序：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="sort" value="0"  data-validate="number:排序必须为数字" />
          <div class="tips"></div>
        </div>
      </div>
     
      
     <div class="form-group">
        <div class="label">
          <label>显示：</label>
        </div>
        <div class="field">
          <div class="button-group radio">
          
          <label class="button active">
         	  <span class="icon icon-check"></span>             
              <input name="status" value="1" type="radio" checked="checked">是             
          </label>             
        
          <label class="button active"><span class="icon icon-times"></span>          	
              <input name="status" value="0"  type="radio" checked="checked">否
          </label>         
           </div>       
        </div>
     </div>
       
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>

<script>
opt = '<input type="text" class="selinp" style="height:40px;" name="url" value="http://" />';
$("#ccss").html(opt);
$("#mokuai").change(function(){

	var mkid=$(this).val();
	if(mkid==1){
		opt = '<select name="cid" class="selinp"><option value ="0">请选择分类</option><foreach name="data['artcate']" item="item"><option value ="{$item.id}">{$item.name}</option></foreach></select>';
		$("#ccss").html(opt);
		
	}else if(mkid==2){
		opt = '<select name="cid" class="selinp"><option value ="0">请选择单页</option><foreach name="data['page']" item="item"><option value ="{$item.id}">{$item.title}</option></foreach></select>';
		$("#ccss").html(opt);
		
	}else if(mkid==0){
		opt = '<input type="text" class="selinp" style="height:40px;" name="url" value="http://" />';
		$("#ccss").html(opt);
		
	}
	
	});

</script>

</body></html>